<?php

declare(strict_types=1);

namespace app\model;

use think\model\concern\SoftDelete;

/**
 * 
 *
 * @mixin \think\Model
 * @property-read \app\model\BaseSupplier $supplier
 * @property-read \app\model\Agent $agent
 * @property-read \app\model\OrderWkyOilCard $oil_card_order
 * @property-read \app\model\OrderWkyPower $power_order
 * @method static \think\db\Query onlyTrashed()
 * @method static \think\db\Query withTrashed()
 */
class OrderParent extends CommonModel
{
    use SoftDelete;

    protected static $payType = [0 => '', 1 => '微信支付', 2 => '支付宝支付', '3' => '后台添加'];

    /*
     供应商
    */
    public function supplier()
    {
        return $this->hasOne(BaseSupplier::class, 'id', 'supplier_id');
    }

    /*
     代理商
    */
    public function agent()
    {
        return $this->hasOne(Agent::class, 'id', 'agent_id');
    }

    /*
    油卡订单
    */
    public function oilCardOrder()
    {
        return $this->hasOne(OrderWkyOilCard::class, 'order_id');
    }

    /*
    电费订单
    */
    public function powerOrder()
    {
        return $this->hasOne(OrderWkyPower::class, 'order_id');
    }
}
